<template>
  <div class="block">
    <el-timeline>
      <el-timeline-item v-for="(item,index) of timeline" :key="index" :timestamp="item.timestamp" placement="top">
        <el-card>
          <h4>{{ item.title }}</h4>
          <p>{{ item.content }}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
export default {
  data() {
    return {
      timeline: [
        {
          timestamp: '2021/7/20',
          title: '设备创建',
          content: '20：23 由用户 20181703 创建'
        },
        {
          timestamp: '2021/7/22',
          title: '设备入库',
          content: '14：40 由用户 20181703 入库'
        },
        {
          timestamp: '2021/7/22',
          title: '设备出库',
          content: '14：55 由用户 20181700 借出'
        },
        {
          timestamp: '2021/7/22',
          title: '设备转借',
          content: '15：20 由用户 20181700 转接给 20181703'
        },
        {
          timestamp: '2021/7/22',
          title: '设备入库',
          content: '18：20 用户 20181703 归还仓库'
        }
      ].reverse()
    }
  }
}
</script>
